# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>

_pkgname=sphinx-argparse-cli
pkgname=python-$_pkgname
pkgver=1.11.0
pkgrel=2
pkgdesc='Render CLI arguments (sub-commands friendly) defined by argparse module'
arch=('any')
url='https://github.com/tox-dev/sphinx-argparse-cli'
license=('MIT')
depends=('python' 'python-sphinx' 'python-docutils-stubs')
makedepends=('python-build' 'python-installer' 'python-hatchling' 'python-hatch-vcs')
checkdepends=('python-pytest')
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
sha512sums=('adb1c9c2c04cc2d714403806b71705a09ea085e562bd2e97d73249e5b33a1341880151b200a96734291606318acc4d8f7c23d3d42798e677744a37496d88d5ac')

build() {
  cd $_pkgname-$pkgver

  SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver python -m build -nwx
}

check() {
  cd $_pkgname-$pkgver

  PYTHONPATH=src pytest
}

package() {
  cd $_pkgname-$pkgver

  python -m installer -d "$pkgdir" dist/*.whl

  install -Dm 644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

# vim:set ts=2 sw=2 et:
